import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { registerIcons } from '/@/utils/common'
import { MotionPlugin } from '@vueuse/motion'
import ElementPlus from 'element-plus'
import mitt from 'mitt'
import pinia from '/@/stores/index'
import { directives } from '/@/utils/directives'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/display.css'
import 'font-awesome/css/font-awesome.min.css'
import '/@/styles/index.scss'
import StarfishEditor from 'starfish-editor'
import 'starfish-editor/src/styles/index.scss'
// import formCreate from '@form-create/element-ui'
import {formCreate} from '@form-create/designer';
import FcDesigner from '@form-create/designer'
import zhLocale from 'element-plus/lib/locale/lang/zh-cn'

// modules import mark, Please do not remove.

async function start() {
	const app = createApp(App)
	app.use(formCreate)
	app.use(FcDesigner)
	app.use(router)
	app.use(pinia)
	app.use(MotionPlugin)
	app.use(StarfishEditor)
	// app.use(ElementPlus)
	app.use(ElementPlus, {
		locale: zhLocale,
	})
	// 全局注册
	directives(app) // 指令
	registerIcons(app) // icons
	app.mount('#app')

	// modules start mark, Please do not remove.

	app.config.globalProperties.eventBus = mitt()
}

start()
